﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partial class ServicesSheet_StockList : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            this.StockBind("", "");

            MasterPage_MasterPage master = (MasterPage_MasterPage)this.Page.Master;
            master.HelpHref = "~/Help/ServicesSheet/库存查询.htm";
            master.PageName = "办公用品库存查询";
            master.PicUrl = "";
            master.IntiBar();
        }
    }

    private void StockBind(string sid, string typeId)
    {
        string sql = string.Format("execute proc_OfficeSupplies_Stock '{0}','{1}'", sid, typeId);
        DataSet Tmp = Srvtools.CliUtils.ExecuteSql("GLModule", "cmdRefValUse", sql, true, Srvtools.CliUtils.fCurrentProject);
        this.wgvMaster.DataSource = Tmp.Tables[0];
        this.wgvMaster.DataBind();

    }

    protected void btnSearch_Click(object sender, EventArgs e)
    {
        string strSid = this.QuerySId.BindingValue;
        string strTid = this.WebDropDownList1.SelectedValue;
        this.StockBind(strSid, strTid);
    }
    protected void btnClear_Click(object sender, EventArgs e)
    {
        this.QuerySId.BindingValue = "";
        this.QuerySId.BindingText = "";

        this.WebDropDownList1.SelectedIndex = 0;

        this.StockBind("", "");

    }
}
